<template>
  <div class="app-container" style="margin-top: 10px">
    <el-form>
      <el-select
        clearable
        v-model="form.type"
        placeholder=""
        style="width: 100%"
      >
        <el-option
          v-for="item in columns1"
          :key="item.value"
          :value="item.value"
          :label="item.text"
        ></el-option>
      </el-select>
      <div style="margin: 16px">
        <el-button type="primary" @click="onSubmit"> 确定 </el-button>
      </div>
    </el-form>
  </div>
</template>

<script>
import { add } from "@/api/airport/outfield";
export default {
  name: "SelectMore123",
  components: {},
  props: {},
  computed: {},
  data() {
    return {
      result: "",
      result1: "",
      form: {
        typeName: "",
        type: 1,
      },
      showPicker: false,
      showPicker1: false,
      columns: [],
      columns1: [
        {
          text: "工作者",
          value: 1,
        },
        {
          text: "复核者",
          value: 2,
        },
      ],

      a1: [],
      a3: [],
      a2: [],
      minDate: new Date(2020, 0, 1),
      maxDate: new Date(2025, 10, 1),
      currentDate: new Date(),
    };
  },
  created() {
    console.log(this.$route.query, this.$route.query.type, "444");
    this.form.type = 1;
    this.form.typeName = "工作者";
  },

  methods: {
    onConfirm1() {
      this.form.type = selectedOptions[0]?.value;
      this.form.typeName = selectedOptions[0]?.text;
      this.showPicker1 = false;
    },
    onSubmit(values) {
      const source = this.form.type === 1 ? "add" : "edit";
      if (this.$route.query.type == 1) {
        this.$router.push({
          path: "/user/content",
          query: {
            source: source,
            id: this.$route.query.id,
          },
        });
      }
      if (this.$route.query.type == 2) {
        this.$router.push({
          path: "/user/transport",
          query: {
            source: source,
            id: this.$route.query.id,
          },
        });
      }
      if (this.$route.query.type == 3) {
        this.$router.push({
          path: "/user/repair",
          query: {
            source: source,
            id: this.$route.query.id,
          },
        });
      }
      if (this.$route.query.type == 4) {
        this.$router.push({
          path: "/user/leave",
          query: {
            source: source,
            id: this.$route.query.id,
          },
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.app-container {
  width: 100%;
  height: 100vh;
  .app-page {
    width: 100%;
    height: calc(100% - 50px);
  }
  .app-footer {
    background-color: #f7f8fa;
    z-index: 2000;
  }
}
</style>
